package objects;

import java.util.ArrayList;

public class Mobile implements Comparable{
	
	public String station ;
	public String name ;
	private int bandWidthNeeds ; // number of kilobytes
	private int nbTweSubNeed ; // number of packet of 12 subcarrier requested.
	private int[] uploadEtranBandLimit;   // defined by station
	private int[] downloadEtranBandLimit ; // defined by station
	public int etranBandAllocation ; // defined by station Mhz
	public int etranBandAllocationRate ; // defined by station Mbit
	private int receivedFrequency ;	
	private ArrayList<String> gotChannelBandwidth ;
	private int bandWidthGot;
	private int ratePerSymbol;

	//constructeur mobile is connected to the station
	public Mobile() {
		//bandWidthNeeds = tools.getRandomBrandwidth();
	}

	public int getNbTweSubNeed(){
		return this.nbTweSubNeed ;
	}
	public void setNbTweSubNeed(int nbTweSubNeed){
		//this.etranBandAllocation = etranBandAllocationRate ;
		 this.nbTweSubNeed = nbTweSubNeed ;
	}
		
	public int getReceivedFrequency(){
		return this.receivedFrequency ;
	}
	public void setReceivedFrequency( int f){
		this.receivedFrequency = f ;
	}
	
	public ArrayList<String> getGotChannelBandwidth(){
		return this.gotChannelBandwidth ;
	}
	public void setGotChannelBandwidth(ArrayList<String> gotChannelBandwidth){
		this.gotChannelBandwidth =  gotChannelBandwidth ;
	}
	
	public int [] getUploadEtranBandLimit(){ 
		return this.uploadEtranBandLimit ;
	}
	public void setUploadEtranBandLimit(int [] uploadEtranBandLimit){ 
		this.uploadEtranBandLimit = uploadEtranBandLimit ;
	}
	
	public int [] getDownloadEtranBandLimit(){ 
		return this.downloadEtranBandLimit ;
	}
	public void setDownloadEtranBandLimit(int [] downloadEtranBandLimit){ 
		this.downloadEtranBandLimit = downloadEtranBandLimit ;
	}
	
	public int getEtranBandAllocation(){ 
		return this.etranBandAllocation ;
	}
	public void setEtranBandAllocation(int etranBandAllocation){ 
		this.etranBandAllocation = etranBandAllocation ;
	}
	public int getEtranBandAllocationRate(){ 
		return this.etranBandAllocationRate ;
	}
	public void setEtranBandAllocationRate(int etranBandAllocationRate){ 
		this.etranBandAllocationRate = etranBandAllocationRate ;
	}
	
	public int compareTo(Object o) {
		Mobile m = (Mobile)o;
		if (m.getBandWidthNeeds() == this.getBandWidthNeeds())
			return 0;
		else if (m.getBandWidthNeeds()< this.getBandWidthNeeds())
		    return 1;
		else
		    return -1;
    }

	public void setBandWidthNeeds(int bandWidthNeeds) {
		this.bandWidthNeeds = bandWidthNeeds;
	}

	public int getBandWidthNeeds() {
		return bandWidthNeeds;
	}

	public void setBandWidthGot(int bandWidthGot) {
		this.bandWidthGot = bandWidthGot;		
	}
	public int getBandWidthGot() {
		return this.bandWidthGot;		
	}

	public void setRatePerSymbol(int ratePerSymbol) {
		this.ratePerSymbol = ratePerSymbol;
	}

	public int getRatePerSymbol() {
		return ratePerSymbol;
	}
}
